Technote 10008

Tanzania ÇΔ Cupid ÇÃPS2 ÉLÅ[É{Å[ÉhDžǬǢǃ

Written by : KIDA Yasuo (Apple Technology, Inc.)
NAGAMATSU Masato (JapanDTS)
February 1997


ñ⁄éü

ÇÕÇ∂ÇflÇ…

å¥àˆ

âÒîï˚ñ@

ñ{ÉeÉNÉjÉJÉãÉmÅ[ÉgÇÕTanzania & Cupid Ç≈ÉXÉ^Å[ÉgÉAÉbÉvéûÇ…ÉLÅ[É{Å[ÉhÇÃéÌï Ç™ low memory global Ç…ê≥ǵÇ≠ÉZÉbÉgÇ≥ÇÍǃǢǻǢñ‚ëËÇâÒîÇ∑ÇÈï˚ñ@DžǬǢǃãLèqǵÇΩLJÇÃÇ≈Ç∑ÅB


ŰÇÕÇ∂ÇflÇ…

Tanzania ÇΔ Cupid Ç≈ÇÕ ADBÉLÅ[É{Å[ÉhÇÃëºÇ…PS2 ÉLÅ[É{Å[ÉhÉCÉìÉ^Å[ÉtÉFÅ[ÉXÇ™ÉTÉ|Å[ÉgÇ≥ÇÍÇÈÇÊǧDžǻÇËNjǵÇΩÇ™ÅAìÒǬÇÃñ‚ëËǙdžÇËÇ‹Ç∑ÅB

àÍǬñ⁄ÇÃñ‚ëËÇÕÅAADB ÉLÅ[É{Å[ÉhÇæÇØÇ™ê⁄ë±Ç≥ÇÍǃǢÇÈèÍçáÇ≈LJÅAADB manager ÇÕÅAPS2 ÉLÅ[É{Å[ÉhÅuLJÅvê⁄ë±Ç≥ÇÍǃǢÇÈÇΔï‘ǵNjÇ∑ÅBADB manager Çégǡǃê⁄ë±Ç≥ÇÍǃǢÇÈÉLÅ[É{Å[ÉhÇîªífÇ∑ÇÈÇÊǧǻÉvÉçÉOÉâÉÄÇÕÅA PS2 ÉLÅ[É{Å[ÉhÇà ID Ç≈džÇÈ Åg1B(Hex)Åh Çå©ÇΩÇΔÇ´Ç…ÇÕÅAíçà”ǵǻÇ≠ǃÇÕÇ»ÇËÇ‹ÇπÇÒÅBDZ ÇÍÇ™óBàÍÇÃÉLÅ[É{Å[ÉhIDÇ»ÇÁÅAǮǪÇÁÇ≠é¿ç€Ç… PS2 ÉLÅ[É{Å[ÉhǙǬǻǙÇÍǃǢÇÈÇΔîªífÇ≈Ç´Ç‹Ç∑ÅBǵǩǵÅAÅg1B(Hex) Åhà»äODžLJÉLÅ[É{Å[ÉhIDÇ™å©Ç¬Ç©Ç¡ÇΩÇ»ÇÁÅAPS2ÉLÅ[É{Å[ÉhÇÕǬǻǙǡǃ ǢǻǢâ¬î\ê´Ç™Ç†ÇËÇ‹Ç∑ÅBADB ÉLÅ[É{Å[ÉhÇæÇØÇ™Ç¬Ç»Ç™Ç¡ÇƒÇ¢ÇÈÇÃÇ©ÅAADB ÇΔ PS2 ÇΔóºï˚ÇÃÉLÅ[É{Å[ÉhǙǬǻǙǡǃǢÇÈÇÃÇ©Çå©ï™ÇØÇÈDZÇΔÇ™Ç≈ǴǻǢÇÃÇ≈Ç∑ÅB

LJǧàÍǬÇÃñ‚ëËÇÕ KbdType low memory global Ç≈Ç∑ÅBÉXÉ^Å[ÉgÉAÉbÉvéûÇ…í èÌÇ»ÇÁ low memory global Çà KbdType ÇÕÅAÉÜÅ[ÉUÅ[Ç™ÉLÅ[Ç…ç≈èâÇ…êGÇÍÇÈëOÇ≈LJÅAê⁄ë±Ç≥ÇÍǃǢÇÈÉLÅ[É{Å[ÉhÇà ID Çê≥ǵÇ≠é¶ÇµÇƒÇ¢Ç‹Ç∑ÅBǵǩǵÅATanzania ÇΔ Cupid Ç≈ÇÕÅAïKÇ∏ PS2 ÉLÅ[É{Å[ÉhÇà ID Ç≈džÇÈÅg1B(Hex)Åh Ç™ì¸Ç¡ÇƒÇ¢Ç‹Ç∑ÅBÉCÉìÉvÉbÉgÉÅÉ\ÉbÉh Ç‚ã@î\ägí£Ç»Ç«Ç≈ÅAÉXÉ^Å[ÉgÉAÉbÉvéûÇ…ÉLÅ[É{Å[ÉhÇ KbdType Çå©ÇÈDZÇΔÇ…ÇÊǡǃ îªífǵǃǢÇÈÉvÉçÉOÉâÉÄÇÕDZÇÃñ‚ëËÇÃâeãøÇéÛÇØÇ‹Ç∑ÅB

Űå¥àˆ

DZÇÍÇÕ PS2 ÉCÉìÉ^Å[ÉtÉFÅ[ÉXÇ™ ADB ÇÃÇÊǧDž plug & play ÇÉTÉ|Å[ÉgǵǃǢǻǢÇΩÇflÇ≈Ç∑ÅB

ŰâÒîï˚ñ@

à»â∫ÇÃÇÊǧǻï˚ñ@Ç≈ ADB manager ÇégǧDZÇΔÇ…ÇÊǡǃÅAäÆëSÇ≈ÇÕdžÇËÇ‹ÇπÇÒÇ™ÅAñ‚ëËÇÃâeãøÇéÊÇËèúÇ≠DZÇΔ Ç™Ç≈Ç´Ç‹Ç∑ÅB

enum
{
	kADBAddressKeybaord	= 2,
	kKeyboardTypePS2	= 0x1B
};

// See what kind of keyboard is connected		
int	keyboardType = LMGetKbdType();


// Kida 970121 (Bug #1621330)
//
// On Tanzania and Cupid, ADB manager doesn't know if PS2 keyboard is connected or not.
// Even when only an ADB keyboard is connected to those machines (Cupid is not even capable
// of connecting PS2 keybaord), ADB manager returns that a PS2 keyboard is also connected.
// It is found that, on those machines, at startup before the user touchs any keys on the
// keyboard, the KbdType low memory global always sais that the keyboard connected is PS2
// (1B). It makes Kotoeri to put up possiblly a wrong menu depending on what keyboard is
// actually connected.
//
// Workaround the bug by listing all ADB devices by using ADB manager and try to find if
// there is non PS2, i.e. ADB, keyboard connected. If so, it assumes that found ADB
// keybaord is the real keybaord connected. As the side effect, if both PS2 and ADB is
// connected, it always thinks the ADB is the primary keyboard. I think this is OK.
//

if ( keyboardType == kKeyboardTypePS2 )	// if PS2 keybaord is what I found, doubt if it's 
						//  really so and do this hack
{
	int	numADBs = CountADBs();
			
	for ( int anADBIndex = 0; anADBIndex < numADBs; ++ anADBIndex )
	{
		ADBDataBlock	anADBInfo;
		GetIndADB( &anADBInfo, anADBIndex );

		if ( anADBInfo.origADBAddr == kADBAddressKeybaord )	// if this is a keybaord
		{
			if ( anADBInfo.devType != kKeyboardTypePS2 )	// and if the keybaord is
										//  not PS2
			{
				keyboardType = anADBInfo.devType;		// it's the real guy
				break;
			}
		}
	}
			
	// if anADBIndex == numADBs at this point, it means the connected keyboard is really PS2
}


[Table of Contents]

ˇ